package edu.sctu.practice.class02.zhaozhongjun.test3;

/**
 * Created by zhao on 2015/11/11.
 */
public class MyTime {
    private int hour;
    private int minute;
    private int second;

    public MyTime (int hour,int minute,int second){
     this.hour =hour;
      this.minute =minute;
        this.second=second;
    }
    public void display(){

        System.out.println("时间："+hour+":"+minute+":"+second);
    }
    public void addSecond(int sec){

        second =second+sec;
    }
    public void addMinute(int min){

        minute=minute+min;
    }
    public void addHour(int hou){

        hour=hour+hou;
    }
    public void subSecond(int sec){

        second=second-sec;
    }
    public void subMinute(int min){

        minute=minute-min;
    }

    public void subHour(int hou){

        hour=hour-hou;
    }
    public void Test(){

        if(hour<=23&hour>=0&minute<=59&minute>=0&second<=59&second >=0)
            System.out.println("\nTrue\n");
        else
            System.out.println("\nFalse\n");
    }

}
